package com.boc.langxiang.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.boc.langxiang.R;
import com.boc.langxiang.manager.PicassoImageLoader;
import com.boc.langxiang.util.L;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * CreateTime: 2016-06-17上午9:23
 * Author: wjkjinke00@126.com
 * Description:
 */
public class DemoAdapter extends BaseQuickAdapter<String> {

    public DemoAdapter(Context context, List<String> data) {
        super(R.layout.item_demo, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.text, "测试")
                .setOnClickListener(R.id.text, new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        L.i("11111111");
                    }
                });
        PicassoImageLoader.getInstance().displayUrlImage(mContext, "http://img4.imgtn.bdimg.com/it/u=1365080916,3639569330&fm=21&gp=0.jpg", (ImageView) helper.getView(R.id.image));
        PicassoImageLoader.getInstance().displayUrlImage(mContext, "http://img4.imgtn.bdimg.com/it/u=1365080916,3639569330&fm=21&gp=0.jpg", (ImageView) helper.getView(R.id.head));
    }

}
